import request from '@/utils/request'

/**
 * 查询渠道列表
 * @param {*} query 
 * @returns 
 */
export function listChannel(query) {
    return request({
        url: '/channel/pageData',
        method: 'get',
        params: query
    })
}


/**
 * 渠道管理接口-新增
 * @param {*} data 
 * @returns 
 */
export function addChannel(data) {
    return request({
        url: '/channel/add',
        method: 'post',
        data
    })
}

/**
 * 渠道管理接口-详情
 * @param {*} data 
 * @returns 
 */
export function detailChannel(data) {
    return request({
        url: '/channel/detail',
        method: 'get',
        params:data
    })
}

/**
 * 渠道管理接口-修改
 * @param {*} data 
 * @returns 
 */
export function updateChannel(data) {
    return request({
        url: '/channel/update',
        method: 'post',
        data
    })
}
/**
 * 渠道管理接口-删除
 * @param {*} data 
 * @returns 
 */
export function deleteChannel(id) {
    return request({
        url: '/channel/del/'+id,
        method: 'delete',
    })
}

/**
 * 渠道管理接口-变更渠道状态
 * @param {*} data 
 * @returns 
 */
export function upChannelState(data) {
    return request({
        url: '/channel/upChannelState',
        method: 'get',
        params:data
    })
}


// 门店信息接口-分页查询
export function getMenDianList(data) {
    return request({
        url: '/menDian/pageData',
        method: 'get',
        params: data,
    })
}


/**
 * 门店信息接口-更新
 * @param {*} data 
 * @returns 
 */
export function updateMenDian(data) {
    return request({
        url: '/menDian/update',
        method: 'post',
        data,
    })
}
/**
 * 门店信息接口-新增
 * @param {*} data 
 * @returns 
 */
export function addMenDian(data) {
    return request({
        url: '/menDian/add',
        method: 'post',
        data,
    })
}

/**
 * 门店信息接口-详情
 * @param {*} data 
 * @returns 
 */
export function detailMenDian(data) {
    return request({
        url: '/menDian/detail',
        method: 'get',
        params: data,
    })
}
/**
 * 
门店信息接口-重置门店用户密码
 * @param {*} data 
 * @returns 
 */
export function resetPwdMenDian(data) {
    return request({
        url: '/menDian/resetPwd',
        method: 'get',
        params: data,
    })
}


/**
 * 门店用户接口-客户跟进记录分页
 * @param {*} data 
 * @returns 
 */
export function trackPageData(data) {
    return request({
        url: '/MenDianUserController/trackPageData',
        method: 'get',
        params: data,
    })
}

export function changeMenDianState(data) {
    return request({
        url: '/menDian/changeState',
        method: 'get',
        params: data,
    })
}

export function getReportDailyChannel(data) {
    return request({
        url: '/reportDailyChannel/pageData',
        method: 'get',
        params: data,
    })
}

export function getReportDxyWork(data) {
    return request({
        url: '/reportDxyWork/pageData',
        method: 'get',
        params: data,
    })
}

/**
 * 总后台报表统计接口-合作商统计
 * @param {*} data 
 * @returns 
 */
export function getReportAdmin(data) {
    return request({
        url: '/reportAdmin/md',
        method: 'get',
        params: data,
    })
}

